<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>相对定位</title>
		<style>
			/*父元素是相对定位,子元素是绝对定位*/
			#d1{
				border: 1px outset green; 
				position:relative;
				height: 500px;
				
			}
			#d1>div{
				margin: 1px;
			}
			#s1{
				background-color: blue;
				width: 600px;
				height: 40px;
			}
			#s2{
				background-color: red;
				width: 600px;
				height: 40px;
				position: absolute;
				right:40px;
				bottom: 20px;
				/* left: 400px;
				bottom: 20px; */
			}
			#s3{
				background-color: gold;
				width: 800px;
				height: 40px;
			}
		</style>
	</head>
	<body>
		<h2 style="height: 290px;background-color: #008000;">xxxxxxx</h2>
		<div id="d1">
			<div id="s1"></div>
			<div id="s2"></div>
			<div id="s3"></div>
		</div>
	</body>
</html>
